<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登录</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" rel="stylesheet"/>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <style>
        .login-box { max-width: 380px; margin: 80px auto; }
    </style>
    </head>
<body>
<div class="login-box">
  <div class="card">
    <div class="card-body">
      <h4 class="card-title mb-3">系统登录</h4>
      <form action="login.do" method="post">
        <div class="form-group">
          <label>用户名</label>
          <input class="form-control" type="text" name="username" required/>
        </div>
        <div class="form-group">
          <label>密码</label>
          <input class="form-control" type="password" name="password" required/>
        </div>
        <button class="btn btn-primary btn-block" type="submit">登录</button>
        <a class="btn btn-link btn-block" href="index.jsp">返回首页</a>
      </form>
      <div class="mt-3">
        <script>
          (function(){
            if (location.search.indexOf('error') !== -1) {
              document.write('<div class="alert alert-danger" role="alert">账号或密码错误，请重试。</div>');
            }
          })();
        </script>
      </div>
    </div>
  </div>
</div>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.6.4/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>

